<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
		<?php
			include_once "common/db.connection.php";
			include_once "common/inc/class.content.inc.php";
			$content = new PageContent($db);
			$title = $_GET['name'];
			$blocksum = $content->getBlocksSummary($title);
			
		?>
        <title><?php echo $_GET['name'] ?></title>
		
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="description" content="Parallax Slider with jQuery" />
        <meta name="keywords" content="parallax, jquery, slider, slideshow, rotation, perspective"/>
		<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/>
        <link rel="stylesheet" type="text/css" href="css/blocksreader/blocksreader.css" />
		<script src="scripts/blocksviewer/cufon-yui.js" type="text/javascript"></script>
		<script src="scripts/blocksviewer/ChunkFive_400.font.js" type="text/javascript"></script>
		<script type="text/javascript">
			Cufon.replace('h1',{ textShadow: '1px 1px #000'});
			Cufon.replace('h2',{ textShadow: '1px 1px #000'});
			Cufon.replace('.footer',{ textShadow: '1px 1px #000'});
			Cufon.replace('.pxs_loading',{ textShadow: '1px 1px #000'});
		</script>
    </head>
    <body>


		<div id="pxs_container" class="pxs_container">
			<h1><?php echo $blocksum['BlocksName'] ?></h1>
			

			<div class="pxs_loading">Loading pages...</div>
			<div class="pxs_slider_wrapper">
				<ul class="pxs_slider">
				<?php 
				$pagesdir = $blocksum['blocks_dir']."/pages";
				$pages = $content->getBlockContent($pagesdir);
				foreach ($pages as $page)
					echo '<li><img src=\''.$pagesdir."/". $page .'\' alt="First Image" /></li>';
				?>
				
				</ul>
				<div class="pxs_navigation">
					<span class="pxs_next"></span>
					<span class="pxs_prev"></span>
					<div class="thumb_activator"></div>
					<div class="details_activator"></div>
					
				</div>
				<div class ="details_container"></div>
				<div class="thumb_container">
				<ul class="pxs_thumbnails">
				<?php 
					$thumbsdir = $blocksum['blocks_dir']."/thumbs";
					$thumbs = $content->getBlockContent($thumbsdir);
				
					foreach ($thumbs as $thumb) {
						echo '<li><img src=\''.$thumbsdir."/". $thumb.'\' alt="First Image" /></li>';
						
						}
				?>

				</ul>
				</div>
			</div>
		</div>
		
		<!-- The JavaScript -->
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
		<script type="text/javascript" src="scripts/blocksreader/jquery.easing.1.3.js"></script>
        <script type="text/javascript" src="scripts/blocksreader/blocksviewer.js">
			
		</script>

		<script type="text/javascript">
			$(function() {
				var $pxs_container	= $('#pxs_container');
				$pxs_container.blocksViewer();
			});
        </script>

    </body>
</html>